﻿/* ==============================================================================
 * 功能描述：NpcEquipment  
 * 
 * 创 建 者：郑镇泉
 * 
 * 创建日期：2016/4/27 20:27:06
 * ==============================================================================*/
using UnityEngine;
using System.Collections;
using ZZQFrameWork;

public class NpcEquipment : MonoBehaviour
{
    [HideInInspector]
    public PlayerAI PlayerAI;

    private CharacterModule characterModule
    {
        get { return ModuleManager.Instance.Get<CharacterModule>(); }
    }
    private BackpackModule backpackModule
    {
        get { return ModuleManager.Instance.Get<BackpackModule>(); }
    }

    #region 装备操作

    /// <summary>
    /// 穿装备
    /// </summary>
    /// <param name="equip"></param>
    public void WearEquip(GoodsVO equip)
    {
        characterModule.mainRole.WearEquip(equip);
    }

    /// <summary>
    /// 脱装备
    /// </summary>
    /// <param name="type"></param>
    public void DropEquip(Enum_SubGoodsType type)
    {
        characterModule.mainRole.DropEquip(type);
    }

    /// <summary>
    /// 根据装备类型获取对应的装备数据
    /// </summary>
    /// <param name="type"></param>
    /// <returns></returns>
    public GoodsVO GetEquipByEquipType(Enum_SubGoodsType type)
    {
        GoodsVO equip = characterModule.mainRole.GetEquipByType(type);
        if (equip == null)
        {
            Debug.LogError("找不到该部位的装备，部位："+type);
            return null;
        }
        return equip;
    }

    #endregion
}